package org.wj.sql

import org.apache.spark.sql.Dataset
import org.wj.config.LocalSparkSession

object CreateDataset extends LocalSparkSession{
  import spark.implicits._

  private val ds: Dataset[User] = spark.read.json("P:\\Project\\Idea\\bigdata\\spark\\src\\main\\resources\\data\\users.json").as[User]

  ds.filter(_.sex == "Male").filter(_.age > 18).show()
}
